#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>

#include <libxml/parser.h>
#include <libxml/xmlreader.h>
#include <libxml/xmlschemas.h>

#ifndef _FWRULE_H
#define _FWRULE_H

//proto,ip of "any" denotes match any
//port number of 0 denotes match any

typedef struct fwRuleNodeDef {
  int location;
  char *uid;
  char *coment;
  char *proto;
  int ipv;
  char *srcIP;
  int sPort;
  char *dstIP;
  int dPort;
  char *action;
  char *log;
  struct fwRuleNodeDef *next;
  struct fwRuleNodeDef *prev; 
  
} fwRuleNode;

typedef struct {
  unsigned size;
  fwRuleNode* head;
  fwRuleNode* tail;
  fwRuleNode* currPtr;
} fwRuleList;


// Initialize the list by creating the head
int initfwRuleList(fwRuleList *list, fwRuleNode *head);

// Add a node to the list
int addToList(fwRuleList **myList, fwRuleNode **myNode);

#endif


